<?php
/**
 * Created by PhpStorm.
 * User: s.utkin
 * Date: 30.04.2015
 * Time: 17:50
 */

namespace Resources;


use Resources\Config\PackagesConfig;

class Group {
	public static function getPackages($group)
	{
		return isset(PackagesConfig::$groups[$group]) ? PackagesConfig::$groups[$group] : [];
	}

	public static function getResourcesPositions($group)
	{
		$positions = ['js' =>  [], 'css' => []];

		$packages = static::getPackages($group);
		foreach ($packages as $package) {
			$jsPositions = Package::getPositions($package, File::TYPE_JS, false);
			$cssPositions = Package::getPositions($package, File::TYPE_CSS, false);

			$positions['js'] = array_merge($positions['js'], $jsPositions);
			$positions['css'] = array_merge($positions['css'], $cssPositions);
		}

		return $positions;
	}
} 